package com.zheng.sms.rpc.service.impl;

import com.aeye.mbr.common.plugin.mapper.BaseServiceImpl;
import com.aeye.mbr.upms.dao.model.SmsTemplate;
import com.zheng.sms.rpc.mapper.SmsTemplateMapper;
import com.zheng.sms.rpc.service.SmsTemplateService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;


public class SmsTemplateServiceImpl extends BaseServiceImpl<SmsTemplate> implements SmsTemplateService{

    private static Logger log = LoggerFactory.getLogger(SmsTemplateServiceImpl.class);


    @Autowired
    SmsTemplateMapper templateMapper;

    /**
     * @param smsConfigId
     * @param templateType
     * @return
     */
    @Override
    public SmsTemplate getSmsTemplate(Long smsConfigId,String templateType){
        SmsTemplate template = new SmsTemplate();
        template.setTemplateType(templateType);
        template.setDisabled(SmsTemplate.ENABLE);
        template.setSmsConfigId(smsConfigId);
        template = templateMapper.selectOne(template);
        return template;
    }

}
